package com.cefa.edu.dao.provider;

import org.apache.ibatis.javassist.runtime.Desc;
import org.apache.ibatis.jdbc.SQL;

public class UserProvider {
    public String getUserString() {
        return new SQL() {
            {
                SELECT("u.id,u.password,u.id_code ,u.student_id,u.user_name ,u.key_data,r.role_name as rule_name,r.type as roleType");
                FROM("cefa_edu_user u");
                LEFT_OUTER_JOIN("cefa_edu_user_role ur on u.id=ur.user_id");
                LEFT_OUTER_JOIN("cefa_edu_role r on ur.role_id=r.id");
                WHERE("u.password = #{password}");
                WHERE("u.user_name = #{userName}");
                ORDER_BY("r.type asc");
            }
        }.toString();
    }
}
